#!/usr/bin/fish
#在线命令词典，在fish中使用
function mdictionary
    set count (count $argv)
    if test $count -eq 0
        while true
        		read din
        		set cmd "curl v2en.co/"
        		set din (string replace -a " " "%20" $din)
        		set cmd $cmd$din
        		eval $cmd
	   end
    end
  
    set cmd "curl v2en.co"
    set index 1
    set ct "%20"
    for i in $argv #遍历输入参数并进行拼接
        if test $index -eq 1        
            set cmd "$cmd/$i"
        else
            set cmd "$cmd$ct$i"
        end
        set index (math $index+1)
    end
    eval $cmd
end


